<template>
	<view view style="background-color: #333333;height: 100%;">
		<u-navbar :title="$t('base.f30')"></u-navbar>
		<view id="wk_list_div">
			<view class="wk_item_div" v-for="item in list">
				<view style="display: flex;justify-content: space-between;">
					<text>{{item.kuangj_cycle.coin_name}}{{$t('base.f31')}}</text>
					<text class="status">
						{{item.status == 1 ? '进行中' :(item.status == 2 ? '已结束' :(item.status == 3 ? '已取消' : ''))}}
					</text>
				</view>
				<view class="wk_item_btm_div">
					<view class="wk_item_btm_item_div">
						<text class="color_gray">{{$t('base.f32')}}</text>
						<text>{{parseFloat(item.amount)}}</text>
					</view>
					<view class="wk_item_btm_item_div">
						<text class="color_gray">{{$t('base.f33')}}</text>
						<text>{{parseFloat(item.kuangj_cycle.annualized_rate)}}%</text>
					</view>
					<view class="wk_item_btm_item_div">
						<text class="color_gray">{{$t('base.f38')}}</text>
						<text>{{item.Interest}}</text>
					</view>
				</view>

				<view class="date_time_div">
					<view class="date_time_item_div">
						<text class="color_gray">{{$t('base.f34')}}</text>
						<text class="date_time_item_text">{{item.created_at}}</text>
					</view>
					<view class="date_time_item_div">
						<text class="color_gray">{{$t('base.f35')}}</text>
						<text class="date_time_item_text">{{item.value_at}}</text>
					</view>
					<view class="date_time_item_div">
						<text class="color_gray">{{$t('base.f36')}}</text>
						<text class="date_time_item_text">{{item.end_at}}</text>
					</view>

				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import Wk from "@/api/a_wk";
	export default {
		data() {
			return {
				list: [],
			}
		},
		mounted() {
			this.getBuyList()
		},
		methods: {
			getBuyList() {
				Wk.getBuyList({}).then(res => {
					// console.log('getBuyList.res = ', res);
					this.list = res.data
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.color_gray {
		color: #A6A6A6;
		margin: 0 0 4rpx 0;
	}

	#top_div {
		position: relative;
		display: flex;
		flex-direction: column;
		background-color: #FFE3C1;
		margin: 24rpx;
		padding: 24rpx;
		border-radius: 24rpx;
	}

	#money_total_div {
		margin: 24rpx 0 0 0;
	}

	#total_amount {
		font-size: 44rpx;
		margin: 0 24rpx 0 0;
	}

	#top_btm_3_div {
		display: flex;
		justify-content: space-between;
		margin: 48rpx 0 0 0;
	}

	.top_btm_item_div {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	#btn_weituo {
		position: fixed;
		right: 48rpx;
		font-size: 24rpx;
		color: #D3DCC2;
		background-color: #604D29;
		padding: 10rpx 20rpx;
		border-radius: 8rpx;
	}

	#wk_list_div {
		color: white;
		margin: 24rpx;
	}

	.wk_item_div {
		display: flex;
		flex-direction: column;
		background-color: #4D4D4D;
		margin: 24rpx 0 0 0;
		padding: 24rpx;
		border-radius: 24rpx;
	}

	.status {
		background-color: #FFDDB3;
		padding: 6rpx 24rpx;
		border-radius: 8rpx;
		font-size: 24rpx;
	}

	.wk_item_btm_div {
		display: flex;
		justify-content: space-between;
		margin: 24rpx 0 0 0;
	}

	.wk_item_btm_item_div {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.date_time_div {
		display: flex;
		flex-direction: column;
		margin: 24rpx 0 0 0;
		font-size: 26rpx;
	}

	.date_time_item_div {
		display: flex;
	}

	.date_time_item_text {
		font-size: 24rpx;
		margin: 0 0 0 24rpx;
	}
</style>